<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试</title>
</head>
<body>


    <button id="submit">提交申请</button>

    <span style="float:left;background-color:red;height:22px;width:22px;border-radius:11px 11px;text-align: center;"></span>


<script src="js/jquery-3.4.1.min.js"></script>
<script>

    setInterval(f,4000)

    function f(){
        $.ajax({
            url:"load",
            type:"post",
            success:function (data) {
                if(data!=0){
                    $.ajax({
                        url:"jian",
                        type:"post",
                        data:"b="+data,
                        success:function () {
                            if($("span").text()=="")
                                $("span").text("0")
                            $("span").text(parseInt($("span").text())+data)
                        }
                    })
                }
            }
        })
    }


    $("#submit").click(function () {
        $.ajax({
            url:"test",
            type:"post"
        })
    })
</script>
</body>
</html>